﻿using DayuCode.Designer.Entity.UI;
using DayuCode.Designer.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DayuCode.Designer.Service.ui
{
    public class DataGridHandler
    {
        private static string getBaseUrl(string methodName)
        {
            return AppInstance.ApiServer + "api/base/dayucode_datagridHandler/" + methodName;
        }

		public static HDataGrid getDataGrid(long id)
		{
			HDataGrid obj = QHttpClient.Post<HDataGrid>(getBaseUrl("getDataGrid"), new { id = id });
			return obj;
		}

		public static void deleteDataGrid(long id)
		{
			QHttpClient.Execute(getBaseUrl("deleteDataGrid"), new { id = id });
		}

		public static HDataGrid saveDataGrid(HDataGrid item)
		{
			HDataGrid obj = QHttpClient.Post<HDataGrid>(getBaseUrl("saveDataGrid"), new { item = item });
			return obj;
		}
	}
}
